package com.aaa.service.impl;

import com.aaa.dao.TypeMapper;
import com.aaa.entity.Type;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper,Type> {
    @Resource
    TypeMapper typeMapper;

    public List<Type> select() {
        return typeMapper.selectList(null);
    }
    public Integer insert(Type type){
        return typeMapper.insert(type);
    }
    public Integer delete(Integer tid){
//        HashMap<String, Object> hashMap = new HashMap<String,Object>();
//        hashMap.put("tid",tid);
//        QueryWrapper<Type> queryWrapper=new QueryWrapper<Type>();
//        queryWrapper.eq("tid",tid);
        return typeMapper.deleteById(tid);
    }
    public Integer update(Type type){
//        QueryWrapper<Type> queryWrapper=new QueryWrapper<Type>();
//        queryWrapper.eq("tid",type);
        return typeMapper.updateById(type);
    }

}
